import sys
import os
import requests

# sys.path.append("..")
# sys.path.append("../utils")
# os.environ.update({"DJANGO_SETTINGS_MODULE": "server.settings"})
# django.setup()
# from django.test import Client

# client = Client()

baseUrl = u"http://127.0.0.1:8000/api/question/"




def addQuestion():
    iputData = {
        "title":"0526测试",
        "questionContent":"问题测试",        
        "softwareVersionId":1,
        "token":"0d526c2eedf2f7e5b202",
    }
    res = requests.post(baseUrl + 'raise/', data=iputData)
    print(res.content)


def getQuestionList():
    iputData = {
        'page':'1',
        'maxItem' : '5',        
        "softwareVersionId":"1",
        "token":"24af9e53417b3d766552",
        "questionState":'0',          
    }
    res = requests.post(baseUrl + 'list/', data=iputData)
    print(res.content)

def questionOption():
    iputData = {     
        "questionId":"13",
        "token":"61aa3da28253d3877c20",
        "operation":'0',
        "handleContent":"0526测试处理问题",                  
    }
    res = requests.post(baseUrl + 'option/', data=iputData)
    print(res.content)

def questionScreen():
    iputData = {       
        "token":"80dd9bc3de1a768f6d41",
        'page':'1',
        'maxItem' : '5', 
        "warZoneId":'5',
        "companyId":'',
        "storehouseId":'', 
        "key":'',
        "questionState":0,
        "softwareVersionId":'' ,                       
    }
    res = requests.post(baseUrl + 'screen/', data=iputData)
    print(res.content)

def questionAnnounce():
    iputData = {     
        "noticeId":"24",
        "token":"61aa3da28253d3877c20",                 
    }
    res = requests.post(baseUrl + 'onequestion/', data=iputData)
    print(res.content)

if __name__ == '__main__':
    # addQuestion()
    # getQuestionList()
    # questionOption()
    # questionScreen()
    questionAnnounce()
